Skip to content

fix(gbrain-sources): bump sources list --json timeout 10s → 30s#1507

Closed
thehashrocket wants to merge 1 commit into
garrytan:mainfrom
thehashrocket:fix/probe-source-timeout
Closed

fix(gbrain-sources): bump sources list --json timeout 10s → 30s#1507
thehashrocket wants to merge 1 commit into
garrytan:mainfrom
thehashrocket:fix/probe-source-timeout

Conversation

@thehashrocket
Copy link
Copy Markdown
Contributor

Summary

  • Bump the gbrain sources list --json timeout from 10s to 30s in both probeSource() and sourcePageCount() (lib/gbrain-sources.ts).
  • Matches the 30s ceiling already used by sources add / sources remove in the same file.

Why

On Supabase free-tier engines, gbrain sources list --json can take noticeably longer than 10s after a cold start. Observed today on a fresh /sync-gbrain invocation:

$ time gbrain sources list --json
... 14.5s total

That blew past probeSource()'s 10s timeout and surfaced as:

ERR   code   source registration failed: spawnSync gbrain ETIMEDOUT (23.8s)

The CLI itself was healthy — gbrain sources add (30s timeout) succeeded on the same machine when invoked manually, and a /sync-gbrain --code-only retry after that completed cleanly (98 pages, 310 chunks). The probe just needs more rope when the underlying engine is cold.

Test plan

  • bun test lib/gbrain-sources.test.ts (if covered) still passes
  • Manual: /sync-gbrain on a Supabase-backed install after >7d inactivity (cold-start) succeeds on the first invocation instead of needing a --code-only retry
  • No regression on PGLite-backed installs (timeout is an upper bound; fast engines still return quickly)

🤖 Generated with Claude Code

Supabase free-tier cold-starts can push `gbrain sources list --json` past
10s (observed 14.5s in the wild), causing probeSource() to throw ETIMEDOUT
during /sync-gbrain code stage even though the underlying CLI was healthy.
Matches the 30s ceiling already used by `sources add` / `sources remove`
in the same file.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@garrytan
Copy link
Copy Markdown
Owner

Thank you @thehashrocket. Cherry-picked into v1.40.0.0 with attribution preserved (Author: Jason Shultz). See commit 62ff90c. Consolidated v1.40.0.0 fix wave lands as PR #1547. Closing this one as superseded — your contribution is recognized in CHANGELOG.md and the commit metadata.

@garrytan garrytan closed this May 16, 2026
anbangr added a commit to anbangr/gstack that referenced this pull request May 18, 2026
….1.0

Resolved version-slot collision: upstream's v1.40.0.0 was renumbered to
v1.40.0.5 in the CHANGELOG so it slots cleanly between fork's v1.40.0.0
(supervised-restart sweep fix) and v1.40.1.0 (test-framework detection).
All upstream code, tests, and migrations land verbatim — only the version
header on the changelog entry changed.

Conflict resolutions:
- VERSION: kept fork 1.40.1.0
- package.json: kept fork 1.40.1.0
- CHANGELOG.md: kept fork entries (1.40.1.0, 1.40.0.0 supervised-restart)
  + added upstream's gbrain-sync entry renumbered to 1.40.0.5 with a note
  explaining the renumber
- bin/gstack-artifacts-init: took upstream's additive patterns
  (projects/*/*-design-*.md, *-test-plan-*.md, *-eng-review-test-plan-*.md)

Upstream PRs landed in this merge (credits in 1.40.0.5 CHANGELOG entry):
- 0xDevNinja (hostname fold garrytan#1468)
- drummerms (hyphen-boundary cut garrytan#1481)
- Jayesh Betala (probe CLI garrytan#1485)
- Jason Shultz (DATABASE_URL seeding garrytan#1508 + timeout garrytan#1507)
- genisis0x (consumer gitignore garrytan#1521, allowlist eng-review garrytan#1465, Windows postinstall garrytan#1487)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants